package com.waves.search.vo.task;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.FieldNameConstants;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author Eden
 * @date 2024/10/12 21:18
 **/
@Document(indexName = "task")
@Getter
@Setter
@FieldNameConstants
public class TaskEsVO {

    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    /**
     * 标题
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String title;
    /**
     * 描述
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String description;
    /**
     * 内容
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String content;
    /**
     * 截止日期
     */
    @Field(value="end_time",type = FieldType.Long)
    private Long endTime;
    /**
     * 任务类型（0普通贴1任务贴2求助贴）
     */
    @Field(type = FieldType.Integer)
    private Integer type;
    /**
     * 赏金金额
     */
    @Field(type = FieldType.Double_Range)
    private Double bounty;

    /**
     * 帖子拥有人id
     */
    @Field(value="user_id",type = FieldType.Long)
    private Long userId;
    /**
     * 赏金数量
     */
    @Field(value="bounty_num",type = FieldType.Long)
    private Long bountyNum;

    /**
     * 点赞数
     */
    @Field(value = "liked_num", type = FieldType.Long)
    private Long likedNum;

    /**
     * 收藏数
     */
    @Field(value = "collected_num", type = FieldType.Long)
    private Long collectedNum;

    /**
     * 创建时间
     * 更新时间
     * 用户头像
     * 用户id
     */
    @Field(value = "user_avatar", type = FieldType.Text)
    private String userAvatar;

    @Field(value = "created_by", type = FieldType.Long)
    private Long createdBy;

    @Field(value = "created_time", type = FieldType.Long)
    private Long createdTime;

    @Field(value = "created_name", type = FieldType.Text)
    private String createdName;

    @Field(value = "updated_by", type = FieldType.Long)
    private Long updatedBy;

    @Field(value = "updated_time", type = FieldType.Long)
    private Long updatedTime;

    @Field(value = "updated_name", type = FieldType.Text)
    private String updatedName;

}
